<?php
ob_start();
session_start();

include("conf/config.php");
include("conf/database.php");
include("conf/tools.php");

$curTime=getIndianDateTime();

foreach($_POST as $key => $value) { $arr_data[$key]=$value;}
foreach($arr_data as $key => $value) { $arr_data[$key]=addslashes($value); }

$arr_data["rec_status"]=1;
$timesheet_id=$_GET["timesheet_id"];
$arr_data["rec_created"]=$curTime;
$arr_data["user_id"]=$_SESSION["user_id"];

$arr_data["timesheet_date"]=getValidDateFormat($arr_data["timesheet_date"]);
if($query_id>0){
	update_qry("dev_user_timesheet",$arr_data,"timesheet_id=".$query_id);
}
else{
	$query_id=insert_qry("dev_user_timesheet",$arr_data);
	
}


header("location:index.php");


?>

